﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using System.Data.SqlClient;
using System.Data;

namespace DAL
{
   public class LOGsWrapper : BaseWrapper, IWrapper<LOGs>
    {

        public List<LOGs> GetAll()
        {
            throw new NotImplementedException();
        }

        public LOGs GetById(int id)
        {
            throw new NotImplementedException();
        }

        public bool Insert(LOGs entity)
        {
            bool status = false;
            SqlConnection cn = new SqlConnection(LogString());
            SqlCommand cmd = new SqlCommand("SP_LOGSHISTORICO_INSERT", cn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@TIPOLOG", entity.TIPOLOG);
            cmd.Parameters.AddWithValue("@MENSAGEM", entity.MENSAGEM);

            try
            {
                cn.Open();
                cmd.ExecuteNonQuery();
                status = true;
            }
            catch (Exception ex)
            {

                Messages += ex.Message;
            }
            finally
            {
                cn.Close();
            }
            return status;

        }

        public bool Update(LOGs entity)
        {
            throw new NotImplementedException();
        }

        public bool Delete(LOGs entity)
        {
            throw new NotImplementedException();
        }
    }
}
